<template>
  <div class="Publish_main">
    <v-header headTitle="发布"></v-header>
    <!--微信页面显示-->
    <a v-if="weixinShow" class="row_list border-bottom-last" href="/publish/Help">
      <div class="img_icon">
        <img src="./images/qiuzhu@2x.png"/>
      </div>
      <div class="row_content">
        <h2>邻里求助专区</h2>
        <p>寻人启物，拼车借东西，举办活动</p>
      </div>
    </a>
    <a v-if="weixinShow" class="row_list border-bottom-last" href="/publish/PublishIdle">
      <div class="img_icon">
        <img src="./images/xianzhiwuping@2x.png"/>
      </div>
      <div class="row_content">
        <h2>闲置商品</h2>
        <p>将闲置的东西变卖，转让，和别人一起分享</p>
      </div>
    </a>
    <a v-if="weixinShow" class="row_list border-bottom-last" href="/publish/ToRent">
      <div class="img_icon">
        <img src="./images/fangwuzhuzu@2x.png"/>
      </div>
      <div class="row_content">
        <h2>房屋出租</h2>
        <p>出租、求租，问周边的邻居更靠谱。</p>
      </div>
    </a>
    <!--<a v-if="weixinShow" class="row_list" href="/publish/Repair">
      <div class="img_icon">
        <img src="./images/repair@2x.png"/>
      </div>
      <div class="row_content">
        <h2>物业报修</h2>
        <p>报修身边的东西</p>
      </div>
    </a>-->
    <!--普通浏览器显示-->
    <div v-if="ordinaryShow" class="row_list border-bottom-last" @click="clickBtn()">
      <div class="img_icon">
        <img src="./images/qiuzhu@2x.png"/>
      </div>
      <div class="row_content">
        <h2>邻里求助专区</h2>
        <p>寻人启物，拼车借东西，举办活动</p>
      </div>
    </div>
    <div v-if="ordinaryShow" class="row_list border-bottom-last" @click="clickBtn()">
      <div class="img_icon">
        <img src="./images/xianzhiwuping@2x.png"/>
      </div>
      <div class="row_content">
        <h2>闲置商品</h2>
        <p>将闲置的东西变卖，转让，和别人一起分享</p>
      </div>
    </div>
    <div v-if="ordinaryShow" class="row_list border-bottom-last" @click="clickBtn()">
      <div class="img_icon">
        <img src="./images/fangwuzhuzu@2x.png"/>
      </div>
      <div class="row_content">
        <h2>房屋出租</h2>
        <p>出租、求租，问周边的邻居更靠谱。</p>
      </div>
    </div>
    <!--<div v-if="ordinaryShow" class="row_list" @click="clickBtn()">
      <div class="img_icon">
        <img src="./images/repair@2x.png"/>
      </div>
      <div class="row_content">
        <h2>物业报修</h2>
        <p>报修身边的东西</p>
      </div>
    </div>-->
    <v-footer></v-footer>
  </div>
</template>
<style lang="scss">
  /*@import "../../common/sass/index.scss";*/

  .Publish_main {
    padding-top: 40px;
    box-sizing: border-box;
    a {
      display: block;
      color: #666;
    }
    .row_list {
      margin: 0 10px;
      height: 90px;
      .img_icon {
        padding-top: 25px;
        padding-bottom: 20px;
        display: inline-block;
        padding-left: 20px;
        img {
          width: 36px;
          height: 36px;
        }
      }
      .row_content {
        display: inline-block;
        margin-left: 10px;
        h2 {
          font-family: "Microsoft YaHei";
          font-size: 15px;
          font-weight: lighter;
          line-height: 35px;
        }
        p {
          font-size: 12px;
          color: #000;
          color: #888;
          line-height: 20px;
        }
      }
    }
    .btn_row {
      width: 100%;
      text-align: center;
      height: 175px;
      button {
        width: 80%;
        height: 38px;
        margin-top: 30px;
        background: #fff;
        border: none;
        outline: none;
        span {
          font-size: 15px;
        }
      }
    }
  }
</style>
<script>
  import Footer from '../footer/Footer.vue'
  import headTop from '../header/Header.vue'
  import {TimeExpired, IsWeiXin} from '../../common/js/isWeixin'
  import {Toast} from 'mint-ui'

  export default {
    name: 'Publish',
    data() {
      return {
        ordinaryShow: {
          type: Boolean // 普通浏览器
        },
        weixinShow: {
          type: Boolean // 微信浏览器
        }
      }
    },
    created() {
      // 判断是否是微信浏览器
      if (IsWeiXin()) {
        this.ordinaryShow = false
        this.weixinShow = true
      } else {
        this.ordinaryShow = true
        this.weixinShow = false
      }
      TimeExpired() // 判断登录时间是否过期
    },
    methods: {
      clickBtn() {
        Toast({
          message: '请在业主在线微信公众号里打开',
          position: 'middle',
          duration: 3000
        })
      }
    },
    components: {
      'v-footer': Footer,
      'v-header': headTop
    }
  }
</script>
